<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>mxAdmin后台管理系统</title>
    <link rel="stylesheet" href="/static/assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="/static/assets/module/admin.css"/>
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    <div class="layui-header">
        <div class="layui-logo">
            <img src="/static/assets/images/logo.png"/>
            <cite>mxAdmin</cite>
        </div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item" lay-unselect>
                <a mx-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a mx-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item" lay-unselect>
                <a mx-event="message" data-url="{:url('mxadmin/tpl/message')}" title="消息">
                    <i class="layui-icon layui-icon-notice"></i>
                    <span class="layui-badge-dot"></span>
                </a>
            </li>
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a mx-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a>
            </li>
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a mx-event="lockScreen" data-url="{:url('mxadmin/tpl/lockscreen')}" title="锁屏"><i class="layui-icon layui-icon-password"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a>
                    <!--<img src="/static/assets/images/head.jpg" class="layui-nav-img">-->
                    <cite>{$admininfo.username}（{$admininfo.nickname}）</cite>
                </a>
                <dl class="layui-nav-child">
                    <dd lay-unselect><a mx-event="psw" data-url="{:url('mxadmin/tpl/password')}">修改密码</a></dd>
                    <dd lay-unselect><a mx-event="clear">清理缓存</a></dd>
                    <hr>
                    <dd lay-unselect><a mx-event="logout" data-url="{:url('mxadmin/login/logout')}">退出登录</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a mx-event="theme" data-url="{:url('mxadmin/tpl/theme')}" title="主题"><i class="layui-icon layui-icon-theme"></i></a>
            </li>
        </ul>
    </div>

    <!-- 侧边栏 -->
    <div class="layui-side">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree arrow2" lay-filter="admin-side-nav" lay-shrink="all">
                <li class="layui-nav-item">
                    <a lay-href="{:url('mxadmin/index/main')}"><i class="layui-icon layui-icon-home"></i>&emsp;<cite>系统首页</cite></a>
                </li>
                {foreach name="sidenav" item="v"}
                <li class="layui-nav-item">
                    <a {if isset($v['children'])}lay-href="javascript:;"{else}lay-href="{:url($v.name)}"{/if}><i class="{$v.icon}"></i>&emsp;<cite>{$v.title}</cite></a>
                    {if isset($v['children'])}
                    <dl class="layui-nav-child">
                        {foreach name="v['children']" item="sub1"}
                        <dd><a lay-href="{:url($sub1.name)}">{$sub1.title}</a></dd>
                        {/foreach}
                    </dl>
                    {/if}
                </li>
                {/foreach}
            </ul>
        </div>
    </div>

    <!-- 主体部分 -->
    <div class="layui-body"></div>
    <!-- 底部 -->
    <div class="layui-footer layui-text">
        Copyright © 2020-2021 <a href="http://www.muxue.com.cn/" target="_blank">福州目雪科技有限公司</a> All Rights Reserved.
        <span class="pull-right">Version 1.0</span>
    </div>
</div>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!-- js部分 -->
<script type="text/javascript" src="/static/assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="/static/assets/js/common.js"></script>
<script>
    layui.use(['layer', 'index', 'admin', 'notice'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var index = layui.index;
        var admin = layui.admin;
        var notice = layui.notice;

        // 默认加载主页
        index.loadHome({
            menuPath: "{:url('mxadmin/index/main')}",
            menuName: '<i class="layui-icon layui-icon-home"></i>'
        });

        admin.events.clear = function(){
            $.get("{:url('mxadmin/tpl/clear')}", function (res) {
                if (res.code === 1) {
                    notice.success({
                        title: '温馨提示',
                        message: res.msg,
                        position: 'center',
                        transitionIn: 'flipInX',
                        transitionOut: 'flipOutX',
                        timeout: 3000,
                    });
                } else {
                    notice.error({
                        title: '温馨提示',
                        message: res.msg,
                        position: 'center',
                        transitionIn: 'flipInX',
                        transitionOut: 'flipOutX',
                        timeout: 3000,
                    });
                }
            });
        }
    });
</script>
</body>
</html>